
import { GET_PERMISSION } from '../mutations-type'
import { getPermissions,addPermissions} from '../../api/permission'
const permission = {
    state: {
        permissions: {
        },

    },
    mutations: {
        [GET_PERMISSION](state, obj) {
            state.permissions = obj
        },
    },
    actions:{
        async getPermissions({commit},obj){
            let permissions = await getPermissions(obj)
            console.log(2222,permissions)
            commit('GET_PERMISSION',permissions.data.data)
        },
        async addPermissions(_,obj){
            console.log(obj,999)
            let permissions = await addPermissions(obj)
            console.log(2222,permissions)
        }
        
    }
}
export default permission